package com.zhy.sping.dao;

import com.zhy.sping.entity.SearchHistory;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

public interface SearchHistoryDao extends JpaRepository<SearchHistory,Integer> {
    @Query(nativeQuery = true,value = "select * from t_searchhistory where uid=:uid order by ctime desc limit 10")
    List<SearchHistory> selectByUid(@Param("uid") int uid);
}
